﻿using Bouyei.Geo.Geometries;
using Bouyei.Geo.GeoParsers.GeoPackage;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Bouyei.Geo.GeoParsers.Parser
{
    public class GeoPackageParser
    {
        GeometryReader reader = null;
        GeometryWriter writer = null;

        public GeoPackageParser() { }

        public virtual Geometry FromReader(byte[] buffer, int offset = 0)
        {
            reader = new GeometryReader(buffer, offset);
            return reader.Reader();
        }

        public virtual byte[] ToWriter(Geometry geometry)
        {
            writer = new GeometryWriter(geometry);
            return writer.Writer();
        }
    }
}
